package myJs.myPkg

import myJs.myPkg.jquery.JQuery
import slinky.readwrite.ObjectOrWritten

import scala.scalajs.js
import scala.language.implicitConversions
import scala.scalajs.js.JSConverters._
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.annotation.JSImport.Namespace


/**
 * Created by yz on 2019/3/14
 */


@js.native
@JSImport("jquery-backstretch", JSImport.Default)
object Backstretch extends js.Object {

}

@js.native
trait Backstretch extends js.Object {

  def backstretch(images: js.Array[String], options: ObjectOrWritten[BackstretchOptions]): JQuery = scalajs.js.native

}

case class BackstretchOptions(
                               fade: js.UndefOr[Double] = js.undefined,
                               duration: js.UndefOr[Double] = js.undefined,
                             )

trait BackstretchJQueryImplicits {

  implicit def implicitBackstretchJQuery(jq: JQuery) = {
    jq.asInstanceOf[Backstretch]
  }
}
